//
//  AXFShopPayMethodsCell.m
//  AXFEightGroup
//
//  Created by ya on 12/28/16.
//  Copyright © 2016 ya. All rights reserved.
//

#import "AXFShopPayMethodsCell.h"


typedef NS_ENUM(NSUInteger, AXFShopPayMethod) {
    AXFShopPayMethodWechatPay       = 0,    /// default pay is wechat.
    AXFShopPayMethodQQPursePay      = 1,
    AXFShopPayMethodAliPay          = 2,
    AXFShopPayMethodDaoPay          = 3
};


@interface AXFShopPayMethodsCell ()


@property (weak, nonatomic) IBOutlet UIButton *wechatPayButton;
@property (weak, nonatomic) IBOutlet UIButton *qqPursePayButton;
@property (weak, nonatomic) IBOutlet UIButton *aliPayButton;
@property (weak, nonatomic) IBOutlet UIButton *daoPayButton;

@end

@implementation AXFShopPayMethodsCell

- (void)awakeFromNib {
    [super awakeFromNib];

    self.wechatPayButton.tag        = AXFShopPayMethodWechatPay;
    self.qqPursePayButton.tag       = AXFShopPayMethodQQPursePay;
    self.aliPayButton.tag           = AXFShopPayMethodAliPay;
    self.daoPayButton.tag           = AXFShopPayMethodDaoPay;
    self.wechatPayButton.selected   = YES;

    self.selectionStyle = UITableViewCellSelectionStyleNone;
    // Initialization code
}

- (void)initState {

    self.wechatPayButton.selected     =  NO;
    self.qqPursePayButton.selected    =  NO;
    self.aliPayButton.selected        =  NO;
    self.daoPayButton.selected        =  NO;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

#pragma mark - Action

- (IBAction)actionSelectedPayMethod:(UIButton *)sender {

    [self initState];

    switch (sender.tag) {
        case AXFShopPayMethodWechatPay:
            NSLog(@"微信支付");
            break;
        case AXFShopPayMethodQQPursePay:
            NSLog(@"QQ钱包支付");
            break;
        case AXFShopPayMethodAliPay:
            NSLog(@"支付宝支付");
            break;
        case AXFShopPayMethodDaoPay:
            NSLog(@"到付");
            break;
        default:
            NSLog(@"突突突");
            break;
    }

    sender.selected = YES;
}

#pragma mark -




@end
